<template>
  <!--ASN/收货单-->
  <div id="Asndetails">
    <v-details
      :detailData="inputData"
      :inputConfig="inputConfig"
      :rules="rules"
      @pop="setdata"
      ref="input"
    ></v-details>
  </div>
</template>

<script>
import details from 'commons/Detail'
import baseMixin from "@/mixins/BaseMixin";

export default {
  mixins: [baseMixin],
  props: {
    inputData: {
      type: Object
    }
  },
  name: "LjkwDetails",
  data () {
    return {
      rules: {
        selectfield: [
          { required: true, message: "请选择筛选字段", trigger: 'blur' },
        ],
        firstvalue: [
          { required: true, message: "请选择第一值", trigger: 'blur' },
        ],
        operators: [
          { required: true, message: "请选择操作符", trigger: 'blur' },
        ],
        andor: [
          { required: true, message: "请选择and/or", trigger: 'blur' },
        ],
      },
    }
  },
  computed: {
    inputConfig () {
      return [
        [
          {
            type: "select",
            label: this.$t('work.selectfield'),
            disabled: false,
            props: "selectfield",
            options: this.getOptions("codelkup/PBSCREENSEL")
          },
          {
            type: "input",
            label: this.$t('wave.firstvalue'),
            disabled: false,
            props: "firstvalue",
          },
          {
            type: "input",
            label: this.$t('wave.secondvalue'),
            disabled: false,
            props: "secondvalue",
          },
        ],
        [
          {
            type: "select",
            label: this.$t('work.operators'),
            disabled: false,
            props: "operators",
            options: this.getOptions("codelkup/PBOPERATORS")
          },
          {
            type: "select",
            label: "AND/OR",
            disabled: false,
            props: "andor",
            options: this.getOptions("codelkup/PBANDINOR")
          },
        ],

      ]
    }
  },
  methods: {
    setdata (data, id, close, listId) {
      if (id == 2 && listId == 0) {
        this.inputData.storerkey = data.storerkey;
      } else if (id == 1 && listId == 5) {
        this.inputData.rtxpofromhourse = data.code
      }
      close(false);
    }
  },
  mounted () {
  },
  watch: {

  },
  components: {
    'v-details': details
  }
}
</script>

<style scoped>
</style>
